import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {ListComponent} from './list/list.component';
import {AddComponent} from './add/add.component';

const routes: Routes = [{
    path: '',
    redirectTo: 'list',
    pathMatch: 'full'
}, {
    path: 'list',
    component: ListComponent
}, {
    path: 'add',
    component: AddComponent
}, {
    path: 'show/:id',
    component: AddComponent
}, {
    path: 'show/:id/:type',
    component: AddComponent
}, {
    path: 'dschool',
    pathMatch: 'full',
    redirectTo: 'show/-1',
}];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class NewsRoutingModule {
}
